<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="model.Account"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Login Page</title>
<script type="text/javascript">
	function checkValidate(){
		if(document.formLogin.txtUserName.value == ""){
			alert("User name is not empty ! Please input user name !");
			return false;
		}if(document.formLogin.txtPassword.value == ""){
			alert("Password is not empty ! Please input Password !");
			return false;
		}else{
			return true;
		}
	}
</script>
</head>
<body>
<%
		session = request.getSession(true);
		Account acc = (Account) session.getAttribute("acc");
		if (acc == null) {
%>
<h1 align="left">Login Page</h1>
<form name="formLogin" action="../ServletLogin" method="post"
	onsubmit="return checkValidate();">
<table align="left" border="1">
	<tr>
		<td>User Name</td>
		<td><input type="text" name="txtUserName" /></td>
	</tr>
	<tr>
		<td>Password</td>
		<td><input type="password" name="txtPassword" /></td>
	</tr>
	<tr>
		<td><input type="submit" value="Login" /></td>
		<td><input type="reset" value="Reset" /></td>
	</tr>
</table>
	
</form>
<%
	}else{
		response.sendRedirect("../UserManagement");
}
%>
</body>
</html>